package com.luo;

import com.luo.demo.DemoController;
import com.luo.demo.DemoService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan("com.luo")
public class AnntationApplication {
	public AnntationApplication() {
		System.out.println("AnntationApplication con");
	}

	public static void main(String[] args) {
		ApplicationContext context = new AnnotationConfigApplicationContext(AnntationApplication.class);
		System.out.println("context initialize success");
//		DemoService demoService = context.getBean(DemoService.class);
//		demoService.demo();
		DemoController bean = context.getBean(DemoController.class);
		DemoController bean2 = context.getBean(DemoController.class);
	}

	public void appdemo(){
		System.out.println("appdemo");
	}
}
